<?php
error_reporting(E_ALL & ~E_NOTICE);
if(isset($_GET[oid])){
	$oid = $_GET[oid];
	require_once("action/sys_conf.inc");
	$link_id = mysql_connect($DBHOST,$DBUSER,$DBPWD);
	mysql_select_db($DBNAME);
	mysql_query("SET NAMES 'utf8'");
	$sql = "select id,title,path,mediaType,listVisible from extpollmedia where subjectItemId='$oid' order by id desc";
	$result = mysql_query($sql);
	if(!mysql_num_rows($result)){
		echo "Sorry,目前没有数据";
		exit;
	}else{
	
?>
<table id="table_media" width="50%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
  <tr>
    <th scope="col">序号</th>
    <th scope="col">标题</th>
    <th scope="col">类型</th>
    <th scope="col">操作</th>
  </tr>
<?php 
	while($media = mysql_fetch_assoc($result)){ 
	$id = $media['id'];
	$title = $media['title'];
	$mediaType = $media['mediaType'];
	switch($mediaType){
		case 0:
			$type = '图片';
			break; 
		case 1:
			$type = '视频';
			break;
		case 2:
			$type = 'flash';
			break;
		default:
			break;  
	} 
?>
  <tr align="center" id="media_<?php echo $id ?>" class="media">
    <td><?php echo $id ?></td>
    <td><?php echo $title ?></td>
    <td><?php echo $type ?></td>
    <td><a href="javascript:void(0)" rel="poll_media_add.php?id=<?php echo $id ?>" onClick="javascript:iframe(2,$(this).attr('rel'))">修改</a>&emsp;&emsp;<a href="javascript:void(0)" onclick="javascript:delPoll('media',<?php echo $id ?>)">删除</a></td>
  </tr>
<?php } ?>
</table>
<?php } } ?>
